package com.deram.ctin.serv.search.entity.solr.api;


import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.customs.entity.CustomsInfo;
import com.deram.ctin.serv.customs.entity.CustomsTrade;
import com.deram.ctin.serv.search.entity.solr.bean.SolrCustomsInfo;
import com.deram.ctin.serv.search.entity.solr.search.WebCustomsSearchParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("serv-search")
@RequestMapping("/solrCustomsInfoApi")
public interface SolrCustomsInfoApi {


    @PostMapping("/find")
    SolrCustomsInfo find(@RequestParam("id") Long id);

    @PostMapping("/searchByKeywords")
    PageResult<SolrCustomsInfo> findByKeyWords(@RequestBody WebCustomsSearchParam keywords, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    @PostMapping("/findAll")
    List<SolrCustomsInfo> findAll();


    @PostMapping("/save")
    SolrCustomsInfo save(@RequestBody CustomsTrade param);

    @PostMapping("/delete")
    void delete(@RequestParam("id") Long id);
}